
from google.appengine.ext import db
from google.appengine.ext.db import djangoforms

class Website(db.Model):
  owner = db.UserProperty()
  name = db.StringProperty(required=True)
  url = db.LinkProperty(required=True)
  description = db.StringProperty(multiline=True)
  created = db.DateTimeProperty(auto_now_add=True)
  modified = db.DateTimeProperty(auto_now_add=True)
  
class WebsiteForm(djangoforms.ModelForm):
  class Meta:
    model = Website
    exclude = ['owner', 'created', 'modified']
    
class Greeting(db.Model):
  website = db.ReferenceProperty(Website)
  author = db.UserProperty()
  content = db.StringProperty(required=True, multiline=True)
  created = db.DateTimeProperty(auto_now_add=True)
  modified = db.DateTimeProperty(auto_now_add=True)
  
class GreetingForm(djangoforms.ModelForm):
  class Meta:
    model = Greeting
    exclude = ['website', 'author', 'created', 'modified']
